<template>
	<view class="order-status-bar">
		<view class="order-status" :class="orderDetail.status==2?'ongoing':orderDetail.status == 3?'finish':''">
			<view class="indicator-light" />
			<view class="status-text">
				{{orderDetail.status==2?'咨询进行中':orderDetail.status == 3?'咨询已结束':''}}
			</view>
		</view>
		<button class="end-btn" @click="putOrderFinish" v-if="orderDetail.status == 2">
			结束咨询
		</button>
	</view>
</template>

<script>
	export default {
		props: {
			orderDetail: {
				type: Object,
			}
		},
		methods: {
			putOrderFinish() {
				uni.showModal({
					title: '结束会话',
					content: '是否确认完成咨询并结束会话？',
					success: (res) => {
						if (res.confirm) {
							this.$emit('complateQuicklyConsult');
						} else if (res.cancel) {

						}
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import "./orderStatusBar.scss";
</style>
